﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using control.Biz;
using System.Collections.Generic;

public partial class usercontrol_frmFind : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            List<BizChuDe> chudes = new List<BizChuDe>();
            chudes = BizChuDe.GetAll();
            BizChuDe tatca = new BizChuDe(0, "Tất Cả");
            chudes.Add(tatca);
            DropDownList1.DataSource=chudes;
            DropDownList1.DataTextField="TenChuDe";
            DropDownList1.DataValueField="MaChuDe";
            DropDownList1.SelectedIndex = chudes.Count - 1;
            DropDownList1.DataBind();
        }

    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        string url = "find.aspx?IDChuDe=" + DropDownList1.SelectedValue.ToString() + "&TenSach=" + TextBox1.Text;
        Response.Redirect(url);
    }
}
